import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import Chat from 'jwchat';
import VueSocketIO from "vue-socket.io";
import axios from 'axios'
import index from "./store";

Vue.config.productionTip = false
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

const token = 'user' + Math.floor((Math.random() * 1000) + 1);
const url = `http://127.0.0.1:8081?token=${token}`;

index.commit('setUserId',token);

Vue.prototype.$axios = axios
Vue.use(ElementUI);
Vue.use(Chat)
Vue.use(new VueSocketIO({
  debug: true,
  connection: url
}))
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


